import request from '@/utils/request'

/**
 * 获取部门列表
 */
// export const getDepartmentApi = () => request({
//   url: '/company/department'
// })

export const getDepartmentApi = () => request.get('/company/department')

// 获取部门负责人
export const getManagerListApi = () => request.get('/sys/user/simple')

// 提交数据
export const addDepartment = data => request.post('/company/department', data)

// 根据部门id获取部门详情
export function getDepartmentDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 更新部门
export const updateDepartmentApi = (data) => request({
  method: 'put',
  url: `/company/department/${data.id}`,
  data
})

// 删除部门
export const delDepartmentApi = (id) => request({
  method: 'delete',
  url: `/company/department/${id}`
})
